package com.zhhtech.zhh.ui.tool.image.select

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import com.zhhtech.zhh.ui.tool.image.select.service.IImageSelect
import com.zhhtech.zhh.ui.tool.image.select.service.impl.ImageSelectActivity
import com.zhhtech.zhh.ui.tool.image.select.service.impl.ImageSelectFragment

val FragmentActivity.imageSelect: IImageSelect get() = ImageSelectBootstrap.get(this)
val Fragment.imageSelect: IImageSelect get() = ImageSelectBootstrap.get(this)

object ImageSelectBootstrap {

    @JvmStatic
    fun get(activity: FragmentActivity): IImageSelect =
        ImageSelectActivity(activity)

    @JvmStatic
    fun get(fragment: Fragment): IImageSelect =
        ImageSelectFragment(fragment)
}